{extend name="layout/popup" /}

{block name="content"}
<div class="popup-header">
    <h1 class="popup-title">邮件发送测试</h1>
</div>
<div class="popup-content">
    <div class="space-20"></div>
    <form id="form_data" class="layui-form" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">收件人邮箱：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" id="to_email" name="to_email" check="required"
                       info="收件人邮箱">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮件标题：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" id="subject" name="subject" check="required"
                       info="发送内容">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮件正文：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" id="content" name="content" check="required"
                       info="发送内容">
            </div>
        </div>
    </form>
</div>
<div class="popup-footer">
    <a class="layui-btn" onclick="save();">发送</a>
    <a class="layui-btn layui-btn-primary" onclick="popup_close();">关闭</a>
</div>
<script type="text/html" id="tool_bar">
    <a class="layui-btn layui-btn-xs" lay-event="save">选择</a>
    <!-- 这里同样支持 laytpl 语法，如： -->
    {{#  if(d.auth > 2){ }}
    <a class="layui-btn layui-btn-xs" lay-event="check">审核</a>
    {{#  } }}
</script>
{/block}

{block name="script"}
<script>
    layui.use(['jquery', 'table'], function () {
        var table = layui.table;
        var where = {};

        var $ = layui.jquery;
        var fn = {
            save: function (data) {
                send_form("form_data", "{:url('')}", function (res) {
                    if (res.code) {
                        layer.msg(res.msg, {
                            time: 1200
                        }, function () {

                        });
                    } else {
                        layer.msg(res.msg);
                        return false;
                    }
                });
            }
        };

        win_exp(fn);


    });
</script>
{/block}
